<template>
  <el-container class="all">
    <el-header>
      中国青年志愿网 上海海洋大学社会实践平台
      <div class="quit">
        <el-avatar
          style="position:relative;top:8px"
          :size="30"
          :src="circleUrl"
        ></el-avatar>
        <span>你好</span> {{ this.$route.query.admin_name }}
        <span @click="quit" style="color:#e25b5b">退出</span>
      </div>
    </el-header>

    <el-container>
      <el-aside width="200px">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          @select="menuclick"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-search"></i>
              <span>查看用户</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="queryStudent">查看现有学生</el-menu-item>
              <el-menu-item index="queryTeacher">查看现有老师</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-delete"></i>
              <span>删除用户信息</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="deleteStudent">删除学生信息</el-menu-item>
              <el-menu-item index="deleteTeacher">删除老师信息</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="AdminLook">
            <i class="el-icon-user"></i>
            <span slot="title">查看个人信息</span>
          </el-menu-item>
        </el-menu>
      </el-aside>

      <el-container>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
    <el-footer>开发人员：谢海杰1951316、温天悦1951337、龚殿尊1951336</el-footer>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      circleUrl:
        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
    };
  },
  created(){
    this.router.push({
        path: `/queryStudent`,
        query: { admin_name: this.$route.query.admin_name }
      });
  },
  methods: {
    quit() {
      this.router.push("/");
      sessionStorage.clear()
    },
    menuclick(index) {
      this.router.push({
        path: `/${index}`,
        query: { admin_name: this.$route.query.admin_name }
      });
    }
  }
};
</script>

<style>
* {
  padding: 0;
  margin: 0;
}
.quit {
  float: right;
  font-size: 13px;
  color: white;
}
.quit span {
  margin-left: 16px;
  font-size: 13px;
  color: white;
  cursor: pointer;
}
.all {
  height: 100%;
}
.el-header,
.el-footer {
  background-color: #636c75;
  color: white;
  line-height: 60px;
  height: 150px;
  text-align: center;
  font-size: 30px;
}

.el-aside {
  background-color: #545c64;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: whitesmoke;
  color: #333;
  text-align: center;
  line-height: 60px;
}
body > .el-container {
  margin-bottom: 40px;
}

</style>
